import bcrypt


def encode_pass(password):
    # 生成盐值
    salt = bcrypt.gensalt()

    # 使用盐值和密码进行哈希
    hashed_password = bcrypt.hashpw(password.encode('utf-8'), salt)

    # 打印哈希后的密码和盐值
    print("Hashed Password:", hashed_password)
    print("Salt:", salt)

    return hashed_password


def verify_pass(input_password, password):
    # 验证密码
    return bcrypt.checkpw(input_password.encode('utf-8'), eval(password))


if __name__ == '__main__':
    pass